package uba.ing2.subite.domain;

/**
 * Representa el "ticket" utilizado para cobrar un viaje en autobus. 
 */
public class BusTripInvoice implements Invoice {
	private AutobusTerminal autobusTerminal;
	private int numberOfPassengers;
	private Number total;

	public BusTripInvoice(AutobusTerminal autobusTerminal, int numberOfPassengers, Number ticketValue) {
		this.numberOfPassengers = numberOfPassengers;
		this.autobusTerminal = autobusTerminal;
		this.total = numberOfPassengers * ticketValue.doubleValue();
	}

	public AutobusTerminal autobusTerminal() {
		return autobusTerminal;
	}

	public int numberOfPassengers() {
		return numberOfPassengers;
	}

	@Override
	public Number total() {
		return total;
	}

	@Override
	public PaymentTerminal paymentTerminal() {
		return autobusTerminal();
	}

	@Override
	public String shortDescription() {
		return "Viaje en autobus " + autobusTerminal.autobus().registrationPlate() + " de " + autobusTerminal.legalEntity();
	}
}
